package com.eian.boot.common.core.context;

import com.alibaba.ttl.TransmittableThreadLocal;

/**
 * 数据权限上下文持有者
 *
 * @author alex.meng
 */
public class DataScopeContextHolder {

    private static final ThreadLocal<String> CONTEXT = new TransmittableThreadLocal<>();

    public static String getSqlCondition() {
        return CONTEXT.get();
    }

    public static void setSqlCondition(String sqlCondition) {
        CONTEXT.set(sqlCondition);
    }

    public static void clear() {
        CONTEXT.remove();
    }
}

